package msu.ml.tools;

import msu.ml.data.*;

public class DbUploader
{
    public static void main(String [] args)
    {
        String database = "nexrad";
        String user = "root";
        String password = "";

        if(args.length < 2)
        {
            System.out.println("Usage: DbUploader DIR FILE [DATABASE] [USER] [PASSWORD]");
            System.exit(0);
        }

        if(args.length > 2)
            database = args[2];

        if(args.length > 3)
            user = args[3];

        if(args.length > 4)
            password = args[4];

        DatabaseDataLoader loader = new DatabaseDataLoader(
            "jdbc:mysql://localhost/" + database, user, password);
        
        loader.setLocalDataDirectory(args[0]);
        loader.preCache(args[1], "0");
    }
}
